# begin secrets
APP_SECRET       = 'shhitsasecret'
ADMIN_LOGIN      = 'admin'
ADMIN_PASS       = 'pass'
# end secrets


SETTINGS_ENV_VAR = 'FLASKR_SETTINGS'
DB_FILE          = 'flaskr.db'
DB_SCHEMA_FILE   = 'schema.sql'
INIT_DB_CMD      = 'initdb'

GET_METHOD    = 'GET'
POST_METHOD   = 'POST'
UNAUTH_STATUS = 401

USERNAME_CSS = 'username'
PASSWORD_CSS = 'password'
TITLE_CSS    = 'title'
TEXT_CSS     = 'text'

ROOT_ROUTE   = '/'
ADD_ROUTE    = '/add'
LOGIN_ROUTE  = '/login'
LOGOUT_ROUTE = '/logout'

DB_ATTR       = 'sqlite_db'
DB_KEY        = 'DATABASE'
USERNAME_KEY  = 'USERNAME'
PASSWORD_KEY  = 'PASSWORD'
TESTING_KEY   = 'TESTING'
HOME_PAGE_KEY = 'show_entries'
HOME_PAGE     = HOME_PAGE_KEY + '.html'
LOGIN_PAGE    = 'login.html'
IS_AUTHED_KEY = 'logged_in'

FETCH_ENTRIES_SQL = 'select title, text from entries order by id desc'
ADD_ENTRY_SQL     = 'insert into entries (title, text) values (?, ?)'

INIT_DB_MSG      = 'Initialized the database.'
LOGIN_MSG        = 'You were logged in'
LOGOUT_MSG       = 'You were logged out'
LOGIN_ERROR_MSG  = 'Invalid username'
PASS_ERROR_MSG   = 'Invalid password'
ADDED_MSG        = 'New entry was successfully posted'
UNAUTHORIZED_MSG = 'Unauthorized'
NO_ENTRIES_MSG   = 'No entries here so far'
